HEART FAILURE PREDICTIONS

In This dataset we are going to create a model on predicting the heart failure.

Importing libraries

Sex - Gender of patient Male = 1, Female =0 Age - Age of patient Diabetes - 0 = No, 1 = Yes Anaemia - 0 = No, 1 = Yes High_blood_pressure - 0 = No, 1 = Yes Smoking - 0 = No, 1 = Yes DEATH_EVENT - 0 = No, 1 = Yes

Now we are going to finding the null values in the data set

we notice that there is no null in the dataset and no categorial values

Now we use the visualization techniques to visualize our data and further fitting into models

NOW BUILD THE MACHINE LEARNING MODLES

Spliting the data

Logistic regression

RANDOM FOREST

DECISION TREE

In these three models let us see which one is the best model for this dataset

In the above table we observed that Random Forest and Decision Tree are more accurate than LogisticRegression

K-FOLD CROSS VALIDATION

In the above observations Random Forest and Decision Tree got 100% accuracy

Let validate our Random Forest

In our model Random Forest has average accuracy 83% with a standard deviation 5%

In our model Decision Tree has average accuracy 75% with a standard deviation 6%

CONCLUSION

We select the dataset about heart failure .Firstly we import all the required libraries and then we perform th data cleaning process by checking the null values after that we tried to visualize our data with some visualization techniques for better undestanding of the dataset after that we create models for predicting the heart failure we create model by using logisticregression ,random forest and decision tree.we got 100% accuracy in random forest and decision tree and logistic regression has 80% accuracy and then we apply cross validation on random forest and decision tree.